Tbbs 2.3-16/Disk 2/SAMPLE2/MENU.SDL

21.3 KB 50a684617b7f1bd9…
;
; eSoft, Inc.
;
; TBBS Sample System #2 Menus
; SDL Source Code
;
; created by: Karl E. Glasgow IV



;***************************************************************************
;******  WE RECOMMEND YOU PRINT THIS FILE IN ITS ENTIRETY FOR REVIEW  ******
;***************************************************************************



; --------------------------------------------------------------------------
; THIS IS THE SDL (SYSTEM DEFINITION LANGUAGE) SOURCE CODE THAT CREATES
; THE SAMPLE MENU SYSTEM #2.  THE COMMENTS IN THIS FILE EXPLAIN EACH PART
; AND ITS PURPOSE.  DON'T BE AFRAID OF THE TERM "LANGUAGE" -- YOU DON'T
; HAVE TO BE A PROGRAMMER TO WORK WITH SDL.
;
; BY READING THROUGH THE COMMENTS IN THIS FILE FROM START TO FINISH, YOU
; CAN GAIN ENOUGH UNDERSTANDING TO ALLOW YOU TO MAKE CHANGES TO THESE MENUS
; WITH THE MINIMUM OF EFFORT.
;
; REMEMBER!  IF YOU MAKE CHANGES TO THESE MENUS YOU MUST RECOMPILE THIS
;            SOURCE CODE SO THAT YOUR CHANGES TAKE AFFECT.  TO RECOMPILE,
;            DO THE FOLLOWING:
;
; FROM THE "C:\TBBS\MENU" DIRECTORY, TYPE "SDL MENU" AND HIT <ENTER>.
; --------------------------------------------------------------------------


; INTRODUCTION:
; --------------------------------------------------------------------------
;
; This sample SDL code is heavily commented to provide you with as
; much context-sensitive help as possible as you review these menus
; and make changes.
;
; (Comments are any lines which begin with a semi-colon ";")

; Nearly all of these sample system menus use a TBBS tool called a
; "Macro".  To make simple changes to these menus, you usually don't
; have to worry about changing the macros that have already been
; defined -- you can just use them (and that's relatively easy).
;
; However, if you wish to view or edit the macros used in the sample
; system, or add new macros of your own, you will find them in a separate
; file called "MACROS.SDL".  Comments in that file will help you
; understand what individual macros do.



; All of the DOS file paths referenced in this menu system are defined
; in the PATHS.SDL file with macros.  This way, global path changes
; can be made without difficulty.
;
Include: PATHS.SDL

; All of the macros which set ANSI colors are contained in the file
; called "COLORS.SDL"
;
Include: COLORS.SDL

; All of the other macros used here are defined in the file called
; "MACROS.SDL"
;
Include: MACROS.SDL




; TBBS MENU DEFINITIONS:
; --------------------------------------------------------------------------

; SDL MENU STRUCTURE:
;
; TBBS menus defined in SDL begin with the "Menu:" keyword, followed
; by the 1-4 character name of the menu.  The last entry in a menu
; definition is the "EndMenu:" keyword.
;
; Within each menu, individual menu entries are marked by the "Entry:"
; keyword first, followed by any number of entry-specific keywords.
;
; For more information on menu structure, available functions and
; commands, etc., see Chapter 6 and 7 of your TBBS reference manual.  The
; tutorial found in the Understanding How It Works Guide also covers this
; in detail.

; MENU ENTRIES IN THIS SAMPLE SYSTEM:
; --------------------------------------------------------------------------

; Each menu entry here has commentary before it, describing briefly what
; the entry is for.

; Most menu entries in this sample system SDL code are laid out as
; follows:
;               Entry:
;               @OPTIONn(key,text)
;               Key=key Type=type Opt Data=optional data
;
; Example:
;               Entry:
;               @OPTION1(F,File Areas)
;               Key=F Type=5 Optdata=FILE
;
; @OPTION1(F,File Areas)
;
; The @OPTION1() macro used in each entry tell TBBS which option on the
; menu you're defining.  This sample menu system allows up to 7 regular
; menu options and 3 global command option per menu.  If you're defining
; the 4th option on the menu, you'd use @OPTION4(), the 6th option would
; be @OPTION6(), and so on.
;
; Inside of the parenthesis of the @OPTION1 macro are two items.  The first
; is the character that will appear highlighted on the menu.  This should
; tell the user what key to press to activate the option.  Second is the
; description of this menu option that will appear on the menu next to the
; highlighted key.  In the above example, the description will read "File
; Areas".
;
; KEY=F
;
; This tells TBBS that this menu option is activated by the user pressing
; the "F" key.  This should match the first item in the @OPTION macro.
; (Otherwise, pressing the highlighted key does nothing!)
;
; TYPE=5
;
; This tells TBBS what it should do if the specified key is pressed by
; the user (in this example, an "F").  Available functions can range from
; 1 to 255.  A comprehensive listing of all menu types appears in your
; TBBS reference manual under Chapter 6.  (The Type=5 in our example here
; sends the user to another menu if selected)
;
; OPT DATA=FILE
;
; OPT DATA stands for "optional data", and it provides TBBS with whatever
; additional information it needs to perform the function you've defined.
; If you want to download files from a particular directory, the Opt Data
; would say which directory that is.  If you want the menu option to allow
; a user to read messages from a particular message area, the Opt Data
; would say which message area, and so on.  (In our example, the Type=5
; sends the user to another menu, and the Opt Data of "FILE" indicates that
; that menu is called "FILE" (MENU: FILE).
;
; --------------------------------------------------------------------------


; NOW FOR THE ACTUAL MENU DEFINITIONS:

; **************************************************************************
; ENTRANCE MENU
; This menu performs functions ONLY ONCE PER CALL, and then sends
; the user to the "MAIN" menu.
; **************************************************************************
;
Menu: 0000

; Automatically run the REGISTER questionnaire if the first flag in
; the user's A1 flag set is OFF (denoted by a ".").  The questionnaire
; itself is called REGISTER.QAL.  See the chapter on QAL in your TBBS
; reference manual for more information on questionnaires.
;
; NOTE: The REGISTER questionnaire has been written so that the user's
; A1 flag settings are changed once the user has entered the requested
; information.  Specifically, the first flag is turned OFF (denoted by
; an "X"), so that the REGISTER questionnaire is run only once for each
; new user.
;
Entry:
Key=^@ Type=32 Opt Data=REGISTER
A1=.-------

; Automatically sends the user to the Main Menu (MENU: MAIN), and
; makes that the new "top level" menu.  Therefore, the user is never
; returned to this menu for the duration of this call.
;
Entry:
Key=^@ Type=35 Opt Data=MAIN

Endmenu:



;
; **************************************************************************
; MAIN MENU
; This is the main system menu (top level menu).
; **************************************************************************
;
Menu: MAIN

; This macro paints a background ANSI image and displays the title
; for the menu.  "FULLMENU.ANS" is the name of the file containing the
; ANSI screen background, and "Main Menu" is the menu's title.
;
@TITLE(FULLMENU.ANS,Main Menu)

; Go to the Message Areas menu (MENU: MESS)
Entry:
@OPTION1(M,Message Areas)
Key=M Type=5 Opt Data=MESS

; Go to the File Areas menu (MENU: FILE)
Entry:
@OPTION2(F,File Areas)
Key=F Type=5 Opt Data=FILE

; Go to the News and Information Menu (MENU: NEWS)
Entry:
@OPTION3(N,News and Information)
Key=N Type=5 Opt Data=NEWS

; Go to the Utilities Menu (MENU: UTIL)
Entry:
@OPTION4(U,Utilities)
Key=U Type=5 Opt Data=UTIL

; Run the "VOTING" questionnaire (QAL)
; The questionnaire itself is called "VOTING.QAL", and can most
; likely be found in the TBBS\QA directory.
Entry:
@OPTION5(P,Participate in User Poll)
Key=P Type=32 Opt Data=VOTING

; View the results thus far of the VOTING questionnaire.
; QAL voting statistics are stored in the VOTING.QAF file
; itself.  To clear the statistics, simply recompile the
; questionnaire by typing "QAL VOTING" from the \QA directory.
;
Entry:
@OPTION6(V,View Results of Poll)
Key=V Type=33 Opt Data=VOTING

; Enter chat mode via the "CHITCHAT" conference.
; Conferences are defined in CEDIT under the <O>ther option.
Entry:
@OPTION7(C,User-to-User Chat)
Key=C Type=52 Opt Data=CHITCHAT

; Go to the Sysop menu, if you have a PRIV level of 255 (MENU: SYSP)
Entry:
@OPTION8(!,Sysop -ONLY- Menu)
Key=! Type=5 Opt Data=SYSP
Priv=255

; Go to the Goodbye menu, prior to logging off the system (MENU: GBYE)
Entry:
@GLOBAL1(G,Goodbye)
Key=G Type=5 Opt Data=GBYE

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND

Endmenu:



;
; **************************************************************************
; FILE AREAS MENU
; File uploads and file download areas.
; **************************************************************************
;
Menu: FILE

; This macro paints a background ANSI image and displays the title
; for the menu.  "FULLMENU.ANS" is the name of the file containing the
; ANSI screen background, and "File Areas" is the menu's title.
;
@TITLE(FULLMENU.ANS,File Areas)

; Allows the user to upload a file with description.  This file
; will be added to the LIST.DIR pseudo directory that can be
; found in the path specified by the UPLDPATH macro.
;
Entry:
@OPTION1(U,Upload a New File)
Key=U Type=47 Opt Data=@UPLDPATH+\LIST

; Allows the user to access the AREAS.FAR file area listing,
; which can be found in the path specified by the DNLDPATH macro.
; Files can then be downloaded from any of the file areas found
; within that FAR listing.
;
Entry:
@OPTION2(D,Download File Section)
Key=D Type=4 Opt Data=@DNLDPATH+\AREAS /z

; Go to the Goodbye menu, prior to logging off the system (MENU: GBYE)
Entry:
@GLOBAL1(G,Goodbye)
Key=G Type=5 Opt Data=GBYE

; Return to the previous menu
Entry:
@GLOBAL2(-,Previous Menu)
Key=- Type=12 Opt Data=1

; Go to the top level menu (usually MENU: MAIN)
Entry:
@GLOBAL3(0,Main Menu)
Key=0 Type=12 Opt Data=0

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND
Endmenu:




;
; **************************************************************************
; MESSAGE AREAS MENU
; Message areas and e-mail menu.
; **************************************************************************
;
Menu: MESS

; This macro paints a background ANSI image and displays the title
; for the menu.  "FULLMENU.ANS" is the name of the file containing the
; ANSI screen background, and "Message Areas" is the menu's title.
;
@TITLE(FULLMENU.ANS,Message Areas)

; Go to the MSGS menu (MENU: MSGS) and reference the "E-Mail" message
; board (as defined in CEDIT under <M>essage, <B>oard Definitions).
; "Electronic Mail" will be the title of that menu.
;
Entry:
@OPTION1(1,Private E-Mail)
Key=1 Type=5 Opt Data=MSGS "Private E-Mail" "E-Mail"

; Go to the MSGS menu (MENU: MSGS) and reference the "General" message
; board (as defined in CEDIT under <M>essage, <B>oard Definitions).
; "General Messages" will be the title of that menu.
;
Entry:
@OPTION2(2,General Messages)
Key=2 Type=5 Opt Data=MSGS "General Messages" "General"

; Go to the MSGS menu (MENU: MSGS) and reference the "Technical" message
; board (as defined in CEDIT under <M>essage, <B>oard Definitions).
; "Technical Discussion" will be the title of that menu.
;
Entry:
@OPTION3(3,Technical Discussion)
Key=3 Type=5 Opt Data=MSGS "Technical Area" "Technical Discussion"

; Go to the MSGS menu (MENU: MSGS) and reference the "Lounge" message
; board (as defined in CEDIT under <M>essage, <B>oard Definitions).
; "The Lounge" will be the title of that menu.
;
Entry:
@OPTION4(4,The Lounge)
Key=4 Type=5 Opt Data=MSGS "The Lounge" "The Lounge"

; Go to the MSGS menu (MENU: MSGS) and reference the "Classifieds" message
; board (as defined in CEDIT under <M>essage, <B>oard Definitions).
; "Classified Ads" will be the title of that menu.
;
Entry:
@OPTION5(5,Classified Ads)
Key=5 Type=5 Opt Data=MSGS "Want Ads" "Classified Ads"

; Go to the Goodbye menu, prior to logging off the system (MENU: GBYE)
Entry:
@GLOBAL1(G,Goodbye)
Key=G Type=5 Opt Data=GBYE

; Return to the previous menu
Entry:
@GLOBAL2(-,Previous Menu)
Key=- Type=12 Opt Data=1

; Go to the top level menu (usually MENU: MAIN)
Entry:
@GLOBAL3(0,Main Menu)
Key=0 Type=12 Opt Data=0

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND
Endmenu:



;
; **************************************************************************
; UTILITIES MENU
; User utilities such as changing your password and terminal
; settings, viewing what other users are currently on-line, duration
; of this call, etc.
; **************************************************************************
;
Menu: UTIL

; This macro paints a background ANSI image and displays the title
; for the menu.  "FULLMENU.ANS" is the name of the file containing the
; ANSI screen background, and "Utilities" is the menu's title.
;
@TITLE(FULLMENU.ANS,Utilities)

; Execute the TBBS command to allow the user to view and alter their
; terminal and user settings.
;
Entry:
@OPTION1(T,Change Terminal Settings)
Key=T Type=31

; Display a text file called "USERSTAT.TXT".  This particular file
; contains Insertion Parameters (see Chapter 2, page 2-14 of your
; TBBS reference manual for more information on Insertion Parameters)
; that will display certain user statistics from the USERLOG file.
;
Entry:
@OPTION2(I,Status Info Display)
Key=I Type=1 Opt Data=USERSTAT.TXT

; Display the date and time of when this call began and how long
; the user has been on-line.
;
Entry:
@OPTION3(D,Display Time Parameters)
Key=D Type=11

; Allow the user to reset the pointers which record what the last
; message read by the user was, message area by message area.
;
Entry:
@OPTION4(R,Reset Last Read Msg Pointers)
Key=R Type=16

; Page the sysop at the local TBBS console.  A bell will ring to alert
; the sysop that someone has requested their attention.
;
Entry:
@OPTION5(S,Chat With the Sysop)
Key=S Type=23

; Allows the user to change their logon password.
;
Entry:
@OPTION6(P,Change Logon Password)
Key=P Type=25

; Presents a listing of what other users are currently on-line
;
Entry:
@OPTION7(W,Who is Online Now)
Key=W Type=50

; Go to the Goodbye menu, prior to logging off the system (MENU: GBYE)
Entry:
@GLOBAL1(G,Goodbye)
Key=G Type=5 Opt Data=GBYE

; Return to the previous menu
Entry:
@GLOBAL2(-,Previous Menu)
Key=- Type=12 Opt Data=1

; Go to the top level menu (usually MENU: MAIN)
Entry:
@GLOBAL3(0,Main Menu)
Key=0 Type=12 Opt Data=0

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND
Endmenu:



;
; **************************************************************************
; UNIVERSAL MESSAGE AREA MENU
; Displays the common message area options such as sending a message,
; reading messages, etc.
;
; * THIS MENU IS USED FOR ALL SYSTEM MESSAGE AREAS, and the commands
;   relate to whichever message area it is instructed to use via menu
;   parameters.
;
; To call this menu from another menu, use the following syntax as a
; part of your menu entry:
;
; Type=5 Opt Data=MSGS "<board name from CEDIT>" "<title of area>"
;
; NOTE: For more information on Menu Parameters, see your TBBS
;       reference manual, Chapter 6, page 6-7.
; **************************************************************************
;
Menu: MSGS

; This macro paints a background ANSI image and displays the title
; for the menu.  "FULLMENU.ANS" is the name of the file containing the
; ANSI screen background, and the title is sent as a menu parameter
; from the menu that called this one.
;
@TITLE(FULLMENU.ANS,%m2%)

; Enter a new message in the specified message area
;
Entry:
@OPTION1(S,Send a Message)
Key=S Type=7 Opt Data=%m1%

; Read messages in the specified message area
;
Entry:
@OPTION2(R,Read Messages)
Key=R Type=6 Opt Data=%m1%

; Scan a listing of messages in the specified message area
;
Entry:
@OPTION3(Q,Quickscan Messages)
Key=Q Type=8 Opt Data=%m1%

; Delete a message in the specified message area
;
Entry:
@OPTION4(D,Delete a Message)
Key=D Type=9 Opt Data=%m1%

; If any unread messages are waiting for this user, display them in
; a listing and allow them to read those messages now.
;
Entry:
@OPTION5(W,Read Waiting Messages)
Key=W Type=15

; Go to the Goodbye menu, prior to logging off the system (MENU: GBYE)
Entry:
@GLOBAL1(G,Goodbye)
Key=G Type=5 Opt Data=GBYE

; Return to the previous menu
Entry:
@GLOBAL2(-,Previous Menu)
Key=- Type=12 Opt Data=1

; Go to the top level menu (usually MENU: MAIN)
Entry:
@GLOBAL3(0,Main Menu)
Key=0 Type=12 Opt Data=0

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND
Endmenu:



;
; **************************************************************************
; NEWS AND INFORMATION
; View text information
; **************************************************************************
;
Menu: NEWS

; This macro paints a background ANSI image and displays the title
; for the menu.  "FULLMENU.ANS" is the name of the file containing the
; ANSI screen background, and "News and Information" is the menu's title.
;
@TITLE(FULLMENU.ANS,News and Information)

; Display the list of available text files under the family name
; of "NEWS" -- see Chapter four of the TBBS reference manual for more
; information about Type 2's.
Entry:
@OPTION1(N,System News)
Key=N Type=2 Optdata=@TEXTPATH+\NEWS

; Display the list of available text files under the family name
; of "INFO" -- see Chapter four of the TBBS reference manual for more
; information about Type 2's.
Entry:
@OPTION2(I,Information About TBBS)
Key=I Type=2 Optdata=@TEXTPATH+\INFO

; Go to the Goodbye menu, prior to logging off the system (MENU: GBYE)
Entry:
@GLOBAL1(G,Goodbye)
Key=G Type=5 Opt Data=GBYE

; Return to the previous menu
Entry:
@GLOBAL2(-,Previous Menu)
Key=- Type=12 Opt Data=1

; Go to the top level menu (usually MENU: MAIN)
Entry:
@GLOBAL3(0,Main Menu)
Key=0 Type=12 Opt Data=0

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND
Endmenu:



;
; **************************************************************************
; SYSOP MENU
; For sysop-level users ONLY (PRIV=255)
; System maintenance and control functions
; **************************************************************************
;
Menu: SYSP

; This macro paints a background ANSI image and displays the title
; for the menu.  "FULLMENU.ANS" is the name of the file containing the
; ANSI screen background, and "Sysop Menu" is the menu's title.
;
@TITLE(FULLMENU.ANS,Sysop Menu)

; Read messages in all message areas together (as if everything were
; contained in one single message area)
;
Entry:
@OPTION1(C,Combined Message Access)
Key=C Type=6

; Choose which message areas should be accessible when reading combined
; messages (see above entry).
;
Entry:
@OPTION2(S,Select/Deselect Combined Areas)
Key=S Type=24

; Allow general file maintenance of the areas/files contained in
; AREAS.FAR.  This FAR file will most likely appear in the "C:\TBBS\XFER"
; directory.
;
Entry:
@OPTION3(F,File Area Maintenance)
Key=F Type=14 Opt Data=@DNLDPATH+\AREAS /z

; Go to the Goodbye menu, prior to logging off the system (MENU: GBYE)
Entry:
@GLOBAL1(G,Goodbye)
Key=G Type=5 Opt Data=GBYE

; Return to the previous menu
Entry:
@GLOBAL2(-,Previous Menu)
Key=- Type=12 Opt Data=1

; Go to the top level menu (usually MENU: MAIN)
Entry:
@GLOBAL3(0,Main Menu)
Key=0 Type=12 Opt Data=0

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND
Endmenu:



;
; **************************************************************************
; GOODBYE MENU
; Allows the user to hangup, return to the last menu, or leave a
; message to the sysop and then hangup.
; **************************************************************************
;
Menu: GBYE

; This macro paints a background ANSI image and displays the title
; for the menu.  "HALFMENU.ANS" is the name of the file containing the
; ANSI screen background, and "Goodbye" is the menu's title.
;
@TITLE(HALFMENU.ANS,Goodbye)

; Log off the system (hangup)
Entry:
@OPTION1(G,Goodbye - Logoff Now)
Key=G Type=10

; Return to the previous menu instead of hanging up
Entry:
@OPTION2(-,Previous Menu)
Key=- Type=12 Opt Data=1

; Enter a message to the sysop, and then hangup
Entry:
@OPTION3(L,Leave a Message First)
Key=L Type=7 Opt Data=MSG TO SYSOP /f:"SYSOP"

; This macro assures that the TBBS "Command:" prompt is displayed in
; white and at the bottom of the screen (see the macro definition).
@COMMAND
Endmenu: